package com.fasteat.mall.service.impl;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 消息生产者
 */
@Component
public class AdvertisementProducer {

	@Autowired
	private RabbitTemplate rabbitTemplate;

	public void send(String id) {
		System.out.println("发布消息成功");
		rabbitTemplate.convertAndSend("advertisementExchange", "", id);
	}


}
